// app/router/reconciliation_route.js
'use strict';

module.exports = app => {
  const { router, controller } = app;
  
  // 对账相关路由
  router.post('/api/v1/reconciliation/smart-match', controller.reconciliationController.generateAnalysisReport);
  router.post('/api/v1/reconciliation/manual-match', controller.reconciliationController.generateAnalysisReport);
  router.put('/api/v1/reconciliation/confirm/:id', controller.reconciliationResultController.confirm);
  router.get('/api/v1/reconciliation/results-new', controller.reconciliationController.getReconciliationResults);
  router.get('/api/v1/reconciliation/generate-report', controller.reconciliationController.generateAnalysisReport);
  // 添加对账报告数据路由
  router.get('/api/v1/reconciliation/report-data', controller.reconciliationController.getReconciliationReportData);
  
  // 对账结果相关路由
  router.get('/api/v1/reconciliation-results', controller.reconciliationResultController.index);
  router.get('/api/v1/reconciliation-results/:id', controller.reconciliationResultController.show);
  router.post('/api/v1/reconciliation-results', controller.reconciliationResultController.create);
  router.put('/api/v1/reconciliation-results/:id', controller.reconciliationResultController.update);
  router.delete('/api/v1/reconciliation-results/:id', controller.reconciliationResultController.destroy);
  router.post('/api/v1/reconciliation-results/:id/confirm', controller.reconciliationResultController.confirm);
  router.post('/api/v1/reconciliation-results/:id/reject', controller.reconciliationResultController.reject);
  
  // 催款记录相关路由
  router.get('/api/v1/collection-records', controller.collectionRecordController.index);
  router.get('/api/v1/collection-records/:id', controller.collectionRecordController.show);
  router.post('/api/v1/collection-records', controller.collectionRecordController.create);
  router.put('/api/v1/collection-records/:id', controller.collectionRecordController.update);
  router.delete('/api/v1/collection-records/:id', controller.collectionRecordController.destroy);
  
  // 导入相关路由
  router.post('/api/v1/import/bank-transactions', controller.importController.importBankTransactions);
  router.get('/api/v1/import/template/:type', controller.importController.getTemplate);
};